package com.sanploy.fed.push.util;

import org.apache.log4j.Logger;

/**
 * 日志操作基础类
 * @author zpq
 *
 */
public class LogInitUtil {

	/**
	 * 写日志文件
	 * @param log
	 */
	public static void  writeLog(Logger log , Exception e ){
		
		StringBuilder sb = new StringBuilder();
		sb.append( e.toString() + "\n");
		StackTraceElement[] ste = e.getStackTrace();
		for (int i = 0; i < ste.length; i++) {
			sb.append("\t\t" + ste[i].toString() + "\n");
		}
		log.error(sb.toString());
	}
	
}
